import {iMicroApp, iMicroPageMeta} from "@peryl/micro-web";
import {MicroAppModule} from "./MicroAppModule";
import {createStaticHook} from "@peryl/utils/createStaticHook";

export const microAppHooks = MicroAppModule.createRegistration(() => {
  const hooks: iMicroApp['hooks'] = {
    /*渲染的页面信息发生变化*/
    onPagesChange: createStaticHook(),
    /*页面组件监听来处理backData，执行页面中的onBack钩子函数*/
    onHandleBackData: createStaticHook<(data: { backData: any, handlePageMeta: iMicroPageMeta }) => void>(),
  };
  return hooks;
});
